package step_two;

public class chaRu {
    public static void main(String[] args) {
//        插入排序
        int query[] = {1, 5, 6, 2, 0, 14, 52, 32, 98};

        test(query);

        for (int i = 0; i < query.length; i++) {
            System.out.print(query[i] + " ");
        }
    }

    public static void test(int query[]) {
        for (int i = 1; i < query.length; i++) {
            int temp = query[i];

            int j = i - 1;
            while (j >= 0 && temp < query[j]) {
                query[j + 1] = query[j];
                j--;
            }
            query[j + 1] = temp;

        }
    }
}
